<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div
      class="content-parent border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style15/Auxiliaryoutlinestyle1Bg.webp'})`,
      }"
    >
      <div class="audio-parent">
        <audioCom :info="props.info" ref="audioParent" />
      </div>

      <div class="content">
        <div class="title-box">{{ props.info.text }}</div>
        <div
          class="content-bottom-1"
          v-if="
            ((props.info.video && props.info.video.url) || props.info.value) &&
            (props.info.subTitle || props.info.remarks)
          "
        >
          <div class="bottom-1-left" :class="{'bottom-1-left-center':!props.info.remarks}">
            <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
            <div class="remarks1" v-if="(props.info.video && props.info.video.url) || props.info.value">
              <TextMax
                :types="4"
                :color2="false"
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="props.info.subTitle?4:6"
              ></TextMax>
            </div>
          </div>
          <div class="bottom-1-right">
            <div class="img-parent">
              <img
                class="img-top"
                :src="publicUrls + 'free/style15/Auxiliaryoutlinestyle1cover.webp'"
                alt=""
              />
              <div class="img-content">
                <div v-if="(props.info.video && props.info.video.url) || props.info.value" class="img-box">
                  <videoview
                    @click="audioplay(false)"
                    :info="props.info"
                    v-if="props.info.video && props.info.video.url"
                  ></videoview>
                  <div v-else class="outline-cover">
                    <img
                      @click="ImgVisible = true"
                      :src="urls + props.info.value + '?imageView2/3/format/webp'"
                      alt=""
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="content-bottom-2" v-else>
          <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <div class="remarks2" v-if="props.info.subTitle">
            <TextMax
              :types="4"
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="5"
            ></TextMax>
          </div>
          <div class="remarks3" v-else-if="props.info.remarks">
            <TextMax
              :types="4"
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="6"
            ></TextMax>
          </div>
          <div class="img-parent" v-if="(props.info.video && props.info.video.url) || props.info.value">
            <img
              class="img-top"
              :src="publicUrls + 'free/style15/Auxiliaryoutlinestyle1cover.webp'"
              alt=""
            />
            <div class="img-content">
              <div class="img-box">
                <videoview
                  @click="audioplay(false)"
                  :info="props.info"
                  v-if="props.info.video && props.info.video.url"
                ></videoview>
                <div v-else class="outline-cover">
                  <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- <div class="content-bottom">
          <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
          <div
            v-if="(props.info.video && props.info.video.url) || props.info.value"
            class="img-box"
            :style="{
              backgroundImage: `url(${
                publicUrls +
                (!props.info.remarks && !props.info.subTitle
                  ? 'free/style15/Auxiliaryoutlinestyle1cover2.webp'
                  : 'free/style15/Auxiliaryoutlinestyle1cover.webp')
              })`,
            }"
          >
            <videoview
              @click="audioplay(false)"
              :info="props.info"
              v-if="props.info.video && props.info.video.url"
            ></videoview>
            <div v-else class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>

          <div class="remarks1" v-if="(props.info.video && props.info.video.url) || props.info.value">
            <TextMax
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="2"
            ></TextMax>
          </div>
          <div class="remarks2" :class="{ remarks3: !props.info.subTitle }" v-else-if="props.info.remarks">
            <TextMax
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 6 : 8"
            ></TextMax>
          </div>
        </div> -->
      </div>
    </div>
  </div>
</template>

 
 
<script setup lang="ts">
import audioCom from './audioCom.vue';
import { publicUrls, textType } from '@/utils/minxin';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax15.vue';
import videoview from './../../../videoDialog/videoview.vue';

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

const ImgVisible = ref(false);
const audioRef = ref(null);
const audioParent = ref(null);
const videoRef = ref(null);
const isPlay = ref(false);
const store = useProjectStore();
const audioplay = (flag: boolean = true) => {
  audioParent.value.videoplay();
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  // align-items: flex-end;
  position: relative;
  margin-top: 0;
  height: 100%;
  margin-right: 140px;
}
.content-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 100px;
  width: 700px;
  height: 412px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.audio-parent {
  position: absolute;
  bottom: 19px;
  right: 52px;
  width: 50px;
  height: 50px;
}
.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 700px;
  height: 412px;
  padding: 73.33px 135px 48px 115px;
}

.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 330px;
  height: 30px;
  color: #ffe2b6;
  text-align: center;
  /* 三级标题 */
  font-family: SourceHanSerifCN-Bold;
  font-size: 20px;
  line-height: 30px; /* 150% */
}
.content-bottom-1 {
  display: flex;
  margin-top: 36.67px;
}
.bottom-1-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 248px;
  margin-right: 16px;
  .subtitle {
    width: 100%;
  }
  .remarks1 {
    margin-top: 8px;
  }
}
.bottom-1-left-center{
  padding-top: 64px;
}
.bottom-1-right {
  display: flex;
  width: 186px;
  .img-parent {
    display: flex;
    position: relative;
    width: 206px;
    height: 200px;
    padding-top: 20px;
  }
  .img-top {
    position: absolute;
    top: 0;
    left: 33.5px;
    width: 119px;
    height: 36px;
    z-index: 30;
  }
  .img-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 186px;
    height: 200px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.1);
    padding: 20px 16px 12px 16px;
  }
}
// .content-bottom {
//   display: flex;
//   flex-direction: column;

// }
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;

  :deep(video) {
    background: rgba(57, 56, 54, 0.1);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.subtitle {
    font-family: SourceHanSerifCN;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  color: rgba(51, 51, 51, 1);
  text-align: center;
}

.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}

.remarks1 {
  width: 100%;
}
.content-bottom-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 450px;
  margin-top: 36.67px;
  .subtitle {
    width: 100%;
  }
  .remarks2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 160px;
    width: 100%;
    margin-top: 8px;
  }
  .remarks3 {
    width: 100%;
    margin-top: 16px;
  }
  .img-parent {
    display: flex;
    position: relative;
    width: 450px;
    height: 224px;
    padding-top: 24px;
  }
  .img-top {
    position: absolute;
    top: 0;
    left: 166px;
    width: 119px;
    height: 36px;
    z-index: 30;
  }
  .img-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 450px;
    height: 200px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.1);
    padding: 16px;
  }
}
</style>
